<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>审核设置</title>

    <!--引入本地 element-ui 的样式，-->
    <link rel="stylesheet" href="/admin/plugin/element-ui/index.css">
    <script type="text/javascript" src="/admin/js-css/js/vue.min.js"></script>
    <script type="text/javascript" src="/admin/plugin/element-ui/index.js"></script>
    <script type="text/javascript" src="/admin/plugin/element-ui/httpVueLoader.js"></script>


    <!--    引入Layui组件-->
    <link rel="stylesheet" href="/admin/plugin/layui/dist/css/layui.css" tppabs="http://res.layui.com/layui/dist/css/layui.css"  media="all">
    <script src="/admin/plugin/layui/dist/layui.js" charset="utf-8"></script>

    <script type="text/javascript" src="/admin/js-css/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/admin/js-css/js/mx1.0.js?v=1.1.1"></script>
    <script type="text/javascript" src="/admin/html/module/yumenyoutian/js/api.js"></script>


</head>
<body>

    <div id="app" style="padding: 20px;">
        <el-form :model="form" label-width="90px">
            <el-form-item label="超时分钟数">
                <el-input
                        v-model="form.date"
                        placeholder="请输入分钟数"
                        type="number"
                        autocomplete="off"
                ></el-input>
            </el-form-item>
            <el-form-item label="处理结果">
                <el-radio-group v-model="form.radio">
                    <el-radio :label="'1'">通过</el-radio>
                    <el-radio :label="'2'">驳回</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="留言">
                <el-input
                        v-model="form.tipMessage"
                        placeholder="请输入审核留言"
                        autocomplete="off"
                ></el-input>
            </el-form-item>
        </el-form>

    </div>

    <script>

        var vm = new Vue({
           el:"#app",
           data:{
               form: {
                   date: "",
                   radio: '1',
                   tipMessage:''
               },
           },
           created(){
               this.getData();
           },
            methods:{
                async getData(){
                    const res = await listAdmin(getTableId("46"),"id",{});
                    this.form = {
                        date: res.data[0].fz,
                        radio: res.data[0].cljg,
                        tipMessage: res.data[0].ly,
                    }
                },

                async saveSetting(){
                    const params = {
                        cljg:this.form.radio,
                        fz: this.form.date,
                        ly: this.form.tipMessage
                    }
                    let i = top.load();
                    const res = await api.postBody(
                        '/admin/api/pmc/ProcessManagementController/settingsToBeApproved',
                        params
                    )
                    top.layer.close(i);
                    if(res.code==1){
                        top.close();
                        top.alert(res.msg);
                    }else{
                        top.alert(res.msg);
                    }
                },
            }
        });
    </script>
</body>
</html>